Repository navigation
Belief-free generator search over HMM symbol matrices as a pipeline stage - #69
Merged
Merged
Conversation
…line stage hmm_generator_search optimizes a k-state HMM's symbol matrices directly, minimizing the state entropy under exact word equalities up to length k + |S+| (which imply equality on all words), with an augmented Lagrangian and analytic gradients. The coupled searches parameterize states by their causal-state beliefs and miss generators whose states' pasts or futures are not belief-mixtures of the causal states'. On the 96 open brackets of the binary 3-state dataset the search lowered seven upper bounds (e.g. n3-t122-d2 from 0.9037 to 0.7956). generative_model runs it after the coupled search (stage 'hmm', hmm_search=True) for k = |S+| .. |S+| + 2 with half the remaining budget, or two k and two starts without one. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sofic.generators.hmm_search:hmm_generator_search(machine, k, starts=..., rng=..., deadline=...)optimizes the symbol matrices of ak-state HMM directly (softmax rows). It minimizes the state entropyH[pi]subject to exact word probabilities for all words up to lengthk + |S+|. Agreement up to that length implies agreement on all words (Tzeng 1992), so feasible points are generators.coupled_seed_from_hmm(problem, matrices)recovers the coupled form(pi, Q, R, K)from the product chains of the HMM with the forward and reverse causal states, so results feed the existing candidate/verification path.generative_model/generative_model_from_bidirectionalget a new stage"hmm"(in the defaultstages) after the coupled search, controlled byhmm_search=Trueandhmm_search_starts=8. With a time budget it triesk = |S+| .. |S+| + 2with half the remaining budget. Without one it triesk = |S+|, |S+| + 1with two starts, about 5 s on 3-state machines.Why
The coupled searches parameterize generator states by their causal-state beliefs
(Q_w, R_w). That parameterization never reached generators whose states' pasts or futures are not belief-mixtures of the causal states'. On the 96 openC_gbrackets of the binary 2-/3-state dataset, a prototype of this search lowered seven upper bounds, all word-verified:n3-t122-d2n3-t140-d3n3-t140-d4n3-t010-d1n3-t122-d1n3-t053-d0n3-t082-d0While wiring the stage in, it also found a generator below the minimal functional generator on the interleaved process
_interleaved(0.1)used intest_generative_model_offers_minimal_functional_generator. That test restrictsstages=("functional",), which is why the stage is gated on"hmm" in stages.Tests
test_objective_gradient_matches_finite_differences(hypothesis): analytic vs finite differences, with and without the entropy term.test_search_returns_exact_generators: every result passes the exact difference-automaton check, satisfies the coupled equations, and has entropy at least the excess entropy.test_search_beats_the_epsilon_machine_on_n3_t122_d2(slow, about 10 s):k = 4reaches below 0.80 (C_mu = 0.9037).test_pipeline_stage_runs_and_can_be_disabled.-n 12). The slowest pipeline tests are in line withmain.Docs (
docs/generators/generative_models.rst, new paragraph and autofunction entries) and CHANGELOG are updated.Tzeng1992andRuebeck2018were added todocs/references.bib; direct parameter search for minimal generators of binary Markov processes is the approach of Ruebeck et al. 2018.Made with Cursor